Neo4j Edge Mapping
The Neo4j enables you to add properties to relationships to describe connections between nodes. In the logical model, this isn’t possible because relationship properties exist only in the physical model.
The Neo4j Edge Mapping feature introduces a mediator entity in the logical model to hold these properties and map them to Neo4j relationships during the conversion process. This approach provides a clear way to capture relationship properties in the logical model, convert logical relationships to physical edges easily, and maintain property consistency across both models.
Capturing Relationship Properties from Physical Edges into Logical Models
In the physical model, a relationship between E_1 and E_2 uses a relationship type (for example, E3) and includes properties such as a, b, c, and d. You can convert the edge to a logical mediator entity with the relationship properties as attributes in the logical model.
To capture relationship properties from a physical edge into the logical model, follow these steps:
-
Open the physical model.
-
Right-click the edge and click Properties.
The Neo4j Relationship Editor opens.
-
Under the Neo4j Relationship Properties section, select the Edge checkbox.
-
Click Close.
A logical mediator entity (for example, E3) is created, and the relationship’s properties are added as attributes (for example, a, b, c, and d).
Converting Mediator Entities to Edges
In Neo4j, entities are represented as nodes, and relationships between them are represented as edges. In a logical model, a intermediate entity connects two other entities.
For example, consider a logical model with entities E/6, E/7, and E/8, where E/7 acts as a intermediate entity and contains attributes such as a, b, and c.
When you view the corresponding physical model, the structure remains the same.
However, you can simplify the physical model by converting E_7 into a direct edge between E_6 and E_8.
Entity to edge conversion is possible only when an entity has both incoming and outgoing relationships.
To convert intermediate entities into edges, follow these steps:
-
Open the physical model.
-
Right-click the intermediate entity (for example, E_7).
-
Click Convert To Edge.
This creates a direct edge (relationship) between E_6 and E_8.
The attributes of the mediator entity (for example, a, b, and c) are added as relationship properties in JSON format. Also, the Relationship Type is set to the name of the mediator entity. To view these properties, right-click the edge, and then click Properties.
The Neo4j Relationship Editor opens and displays the edge's properties.
The following topic explains how Neo4j edge mapping in erwin DM changes based on operations performed in the physical and logical models:
Was this helpful?